package com.itheima.stream;

import java.util.*;
import java.util.stream.Stream;

public class StreamDemo01 {
    public static void main(String[] args) {
        //单列集合
        ArrayList<String> arrayList = new ArrayList<>();
        Collections.addAll(arrayList,"aaa","bbb","ccc");
        arrayList.stream().forEach(s-> System.out.println(s));

        //双列集合
        HashMap<String,String> hashMap = new HashMap<>();
        hashMap.put("001","zs");
        hashMap.put("002","ls");
        hashMap.put("003","ww");
        hashMap.keySet().stream().forEach(s -> System.out.println(s));
        hashMap.keySet().stream().forEach(s->{
            System.out.println(hashMap.get(s));
        });
        hashMap.entrySet().stream().forEach(s-> System.out.println(s));

        //数组
        int[] arrs = {1,2,3,4,5};
        Arrays.stream(arrs).forEach(s-> System.out.println(s));

        //多个数据
        Stream.of(1,2,3,4,5,6,7).forEach(s-> System.out.println(s));
    }
}
